package com.wenjunwu.blog.common;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;

public abstract class BaseDao<T> {

	protected String DEFAULTNAMESPACE;

	protected BaseDao() {
		Type genType = getClass().getGenericSuperclass();
		Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
		DEFAULTNAMESPACE = params[0].toString().substring(6).concat(".");
	}

	@Autowired
	public SqlSessionTemplate sqlSession;

}
